package com.keffect.effects.staticEffects;

import java.awt.AlphaComposite;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Paint;

import com.keffect.effects.StaticEffect;

/**
 * 
 * @author Matias Varela
 *         <p>
 *         Student of Licenciatura en Ciencias de la Computacion, at the
 *         Universidad Nacional del Sur (Argentina).
 *         <p>
 *         project site: http://code.google.com/p/keffect-project/
 * 
 */
public class Transparency extends StaticEffect {

	private static final int RULE = AlphaComposite.SRC_ATOP;
	private Composite comp;
	protected Paint defaultPaint;
	protected float alpha;


	public Transparency(float alpha) {
		super();
		this.alpha = alpha;
	}


	@Override
	public void initEffectProperties() {
		comp = AlphaComposite.getInstance(RULE, alpha);
	}


	@Override
	public void doPaintBefore(Graphics2D g) {
		g.setComposite(comp);
	}


	@Override
	public void doPaintAfter(Graphics2D g) {

	}

}
